package pqt;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.Timer;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.Toolkit;

public class TablaExcentricidad extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private int valorE = 0;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			TablaExcentricidad dialog = new TablaExcentricidad();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public TablaExcentricidad() {
		setIconImage(Toolkit.getDefaultToolkit().getImage(TablaExcentricidad.class.getResource("/img/icono.png")));
		setBounds(100, 100, 661, 427);
		setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBackground(new Color(204, 204, 204));
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		
			//----------------------------------------------Boton Aceptar------------------------------------------------------------
			
			/*final JButton btnBalanzaAceptar = new JButton("");
				btnBalanzaAceptar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						dispose();
					}
				});
				btnBalanzaAceptar.setFocusable(true);
				btnBalanzaAceptar.setContentAreaFilled(false);
				btnBalanzaAceptar.setBorderPainted(false);
				btnBalanzaAceptar.setBorder(null);
				btnBalanzaAceptar.setBounds(186, 259, 271, 75);
				btnBalanzaAceptar.setIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarAzulChico.png")));
				btnBalanzaAceptar.setPressedIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarBlancoChico.png")));
				contentPanel.add(btnBalanzaAceptar);
				
				btnBalanzaAceptar.addMouseListener(new MouseAdapter() {
					
					public void mouseEntered(MouseEvent arg0) {
						btnBalanzaAceptar.setIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarVerdeChico.png")));
						getRootPane().setDefaultButton(btnBalanzaAceptar);
						
					}
					public void mouseExited(MouseEvent e) {
						btnBalanzaAceptar.setIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarAzulChico.png")));
						getRootPane().setDefaultButton(null);
					}
				});
				btnBalanzaAceptar.addFocusListener(new FocusAdapter() {
					@Override
					public void focusGained(FocusEvent arg0) {
						btnBalanzaAceptar.setIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarVerdeChico.png")));
						getRootPane().setDefaultButton(btnBalanzaAceptar);
					}
					@Override
					public void focusLost(FocusEvent e) {
						btnBalanzaAceptar.setIcon(new ImageIcon(testBoton.class.getResource("/img/AceptarAzulChico.png")));
						getRootPane().setDefaultButton(null);
					}
				});*/
		
		
			JLabel lblNewLabel = new JLabel("");
			lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
			lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 25));
			lblNewLabel.setBounds(10, 100, 625, 167);
			valorE = 500;
			lblNewLabel.setText("<html>E =" + valorE + "</html>");
			contentPanel.add(lblNewLabel);
			
			Timer timer = new Timer (2000, new ActionListener () 
			{ 
			    public void actionPerformed(ActionEvent e) 
			    { 
			    	dispose();
			     } 
			}); 
			timer.setRepeats(false);
			timer.start();
			
		
	}

}
